package show.me.the.money.validator;

import java.util.HashMap;
import java.util.Iterator;
import java.util.LinkedHashMap;

public class ValidatorMassage {
	private HashMap<String, String> msgs = new LinkedHashMap<String,String>();
	
	public void addMsg(String field, String msg){
		msgs.put(field, msg);
	}
	public int getCount(){
		return msgs.size();
	}
	public HashMap<String, String> getMsgs(){
		return msgs;
	}
	
	@Override
	public String toString() {
		StringBuilder s = new StringBuilder();
		for(Iterator<String> kit=msgs.keySet().iterator();kit.hasNext();){
			String k = kit.next();
			s.append("[").append(k).append("]").append(":").append(msgs.get(k)).append("\r\n");
		}
		return s.toString();
	}

}
